//
//  ZineViewController.m
//  09-Homework
//
//  Created by dllo on 16/7/26.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "ZineViewController.h"
@interface ZineViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic,retain)NSMutableArray *arrZone;
@end

@implementation ZineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.arrZone = [NSMutableArray arrayWithArray:self.cityModel.array];
    self.navigationItem.title = self.cityModel.name;
    [self creatTableView];
}
-(void)creatTableView{
    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:0];
    [self.view addSubview:self.tableView];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arrZone.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:3 reuseIdentifier:ID];
    }
    self.cityModel = _arrZone[indexPath.row];
    cell.textLabel.text = self.cityModel.name;
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
